Accusoft.PdfXpress7.ActiveX
Create, Modify & Delete Document Metadata

PDF Xpress™ enables users to create, modify and delete document metadata in a PDF document.  

PDF Xpress supports creating, reading, and modifying general information about a PDF document, called Metadata. Metadata is stored in the document information dictionary and can include information such as the document's author, title, and keywords.

To read Metadata for an open PDF document, access the DocumentMetadata of the document and either:

To add or modify Metadata for an open PDF document, access the DocumentMetadata of the document and either:

PDF Xpress does not permit direct modification of CreationDate or ModDate Metadata.

Create Document Metadata

VB Example
Copy Code
'This code demonstrates creating document metadata

On Error GoTo error
Dim pdfXpress1 As  New PdfXpress
pdfXpress1.Initialize
pdfxpress1.RaiseExceptions = True
Dim docColl As New PdfDocumentCollection 
docColl.SetParentControl pdfxpress1
docColl.Add "C:\ mynewfile.pdf ", ""
Dim data As DocumentMetadata
Set data = docColl.GetDocumentAt(0).DocumentMetadata
data.SetItemProperty "Author", "New Author" 
data.SetItemProperty "CreationDate","031508"
data.SetItemProperty  "Creator", "NewCreator"
data.SetItemProperty "ModificationDate","031608"
.
.
.
GoTo finish
error:
MsgBox Err.Description
finish:

Set document = Nothing
pdfxpress1.Terminate
Set pdfxpress1= Nothing

Modify Document Metadata

VB Example
Copy Code
'This code demonstrates modifying document metadata 
On Error GoTo error
Dim pdfXpress1 As  New PdfXpress
pdfXpress1.Initialize
pdfxpress1.RaiseExceptions = True
Dim data As DocumentMetadata
Dim docColl As New PdfDocumentCollection 
docColl.SetParentControl pdfxpress1
docColl.Add "C:\mynewfile.pdf", ""
Set data = docColl.GetDocumentAt(0).DocumentMetadata
data.author = "New Author"
.
.
.
GoTo finish
error:
MsgBox Err.Description
finish:

Set document = Nothing
pdfxpress1.Terminate
Set pdfxpress1= Nothing

Delete Document Metadata

VB Example
Copy Code
'This code demonstrates modifying document metadata 
On Error GoTo error
Dim pdfXpress1 As  New PdfXpress
pdfXpress1.Initialize
pdfxpress1.RaiseExceptions = True
Dim data As DocumentMetadata
Dim docColl As New PdfDocumentCollection 
docColl.SetParentControl pdfxpress1
docColl.Add "C:\mynewfile.pdf", ""
Set data = docColl.GetDocumentAt(0).DocumentMetadata
data.author = ""
.
.
.
GoTo finish
error:
MsgBox Err.Description
finish:

Set document = Nothing
pdfxpress1.Terminate
Set pdfxpress1= Nothing

See Also

 

 


©2017. Accusoft Corporation. All Rights Reserved.

Send Feedback